package top.lyc829.leetcode.T412;

import java.util.ArrayList;
import java.util.List;

public class Solution {

    private boolean isFizz(int n) {
        return n % 3 == 0;
    }

    private boolean isBuzz(int n) {
        return n % 5 == 0;
    }


    public List<String> fizzBuzz(int n) {

        List<String> list = new ArrayList<>();

        for (int i = 1; i <= n; i++) {
            if (isFizz(i) && isBuzz(i)) {
                list.add("FizzBuzz");
            } else if (isFizz(i)) {
                list.add("Fizz");
            } else if (isBuzz(i)) {
                list.add("Buzz");
            } else {
                list.add(String.valueOf(i));
            }
        }
        return list;
    }

    public static void main(String[] args) {
        Solution s = new Solution();
        List<String> res = s.fizzBuzz(15);
        System.out.println(res.toString());
    }

}
